/*
   Copyright 2009 Abdulla Abdurakhmanov (abdulla@latestbit.com)
   Original sources are available at www.latestbit.com

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

package org.latestbit.smartobjects.core;

public class LifecycleControlParams {
	public static final int DEFAULT_MAX_LAST_ACTIVITY_AWAIT_TIME = 30 * 60 * 1000; // 1800 seconds = 30 min 
	private boolean destroyByLastActivityTime = false;
	private boolean destroyByRemoteConnectionClosed = true;
	private int maxLastActivityAwaitTime = DEFAULT_MAX_LAST_ACTIVITY_AWAIT_TIME;
	private boolean destroyWithImplementation = true;
	private boolean availableByInstanceIdForAll = false;
	
	public void setDestroyByLastActivityTime(boolean destroyByLastActivityTime) {
		this.destroyByLastActivityTime = destroyByLastActivityTime;
	}
	
	public boolean isDestroyByLastActivityTime() {
		return destroyByLastActivityTime;
	}
	
	public void setDestroyByRemoteConnectionClosed( boolean destroyByRemoteConnectionClosed) {
		this.destroyByRemoteConnectionClosed = destroyByRemoteConnectionClosed;
	}
	
	public boolean isDestroyByRemoteConnectionClosed() {
		return destroyByRemoteConnectionClosed;
	}

	public void setMaxLastActivityAwaitTime(int maxLastActivityAwaitTimeInSec ) {
		this.maxLastActivityAwaitTime = maxLastActivityAwaitTimeInSec;
	}

	public int getMaxLastActivityAwaitTime() {
		return maxLastActivityAwaitTime ;
	}

	public void setDestroyWithImplementation(boolean mode) {
		this.destroyWithImplementation = mode;
	}
	
	public boolean isDestroyWithImplementation() {
		return this.destroyWithImplementation;
	}

	public void setAvailableByInstanceIdForAll(boolean availableByInstanceIdForAll) {
		this.availableByInstanceIdForAll = availableByInstanceIdForAll;
	}

	public boolean isAvailableByInstanceIdForAll() {
		return availableByInstanceIdForAll;
	}
	
	
}
